public class Student implements Comparable<Student> {

    private  String name;
    private int stuNo;

    public Student(String name, int stuNo) {
        this.name = name;
        this.stuNo = stuNo;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getStuNo() {
        return stuNo;
    }

    public void setStuNo(int stuNo) {
        this.stuNo = stuNo;
    }

    @Override
    public String toString() {
        return "Student{" +
                "name='" + name + '\'' +
                ", stuNo=" + stuNo +
                '}';
    }

    @Override
    public int compareTo(Student o) {
        int n1=this.stuNo-o.getStuNo();
        int n2=this.name.compareTo(o.name);
        return n2;
    }
}
